package com.yyfax.pay.order.data.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.yyfax.commons.lang.DateUtil;
import com.yyfax.framework.service.CacheService;
import com.yyfax.framework.service.impl.BaseServiceImpl;
import com.yyfax.pay.order.data.dao.PayinBatchOrderLogDao;
import com.yyfax.pay.order.data.service.PayinBatchOrderLogService;
import com.yyfax.pay.order.model.po.PayinBatchOrderLogPO;

/**
 * 批量代扣日志服务实现
 *
 * @author maojian
 * @date 2017-04-12 11:09:15
 * @since 1.0.0
 */
@Service
public class PayinBatchOrderLogServiceImpl extends BaseServiceImpl implements PayinBatchOrderLogService {
	private Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private PayinBatchOrderLogDao payinBatchOrderLogDao;

	public PayinBatchOrderLogServiceImpl(@Qualifier("payCacheService") CacheService cacheService) {
		super(cacheService);
	}



	@Override
	public int save(PayinBatchOrderLogPO po) throws Exception {
		if (po == null) {
			logger.debug("参数po为空，返回-1");
			return 0;
		}

		po.setCreateTime(DateUtil.getCurrentDateTime());

		return payinBatchOrderLogDao.insert(po);
	}

}
